/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.rbh.risk.service.impl;

import com.rbh.risk.dao.PrivilegeDao;
import com.rbh.risk.entity.ACL;
import com.rbh.risk.entity.Privilege;
import com.rbh.risk.entity.Role;
import com.rbh.risk.service.PrivilegeService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service("privilegeService")
public class PrivilegeServiceImpl implements PrivilegeService {

    @Autowired
    private PrivilegeDao privilegeDao;
    
    @Transactional(readOnly = false)
    @Override
    public void insert(Privilege privilege) {
        this.privilegeDao.insert(privilege);
    }

    @Transactional(readOnly = false)
    @Override
    public void update(Privilege privilege) {
        this.privilegeDao.update(privilege);
    }

    @Transactional(readOnly = false)
    @Override
    public void delete(Privilege privilege) {
        this.privilegeDao.delete(privilege);
    }

    @Transactional(readOnly = true)
    @Override
    public Privilege getById(Integer categoryId) {
        return this.privilegeDao.getById(categoryId);
    }

    @Transactional(readOnly = true)
    @Override
    public List<Privilege> getByRole(Role role) {
        return this.privilegeDao.getByRole(role);
    }

    @Transactional(readOnly = true)
    @Override
    public List<Privilege> getByACL(ACL acl) {
        return this.privilegeDao.getByACL(acl);
    }

    @Transactional(readOnly = true)
    @Override
    public List<Privilege> getAll() {
        return this.privilegeDao.getAll();
    }
}
